#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QStringListModel>

#include "discoveryservice.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Dialog; }
QT_END_NAMESPACE

class Dialog : public QDialog
{
    Q_OBJECT

public:
    Dialog(QWidget *parent = nullptr);
    ~Dialog();

private:
    Ui::Dialog *ui;
    struct Endpoint {
        QHostAddress addr;
        quint16 port;
    };
    QVector<Endpoint> endpoints;
    DiscoveryService discoveryService;
    QStringListModel hostsStringListModel;

private slots:
    void searchButtonClicked();
    void newHost(const QString &deviceName, const QHostAddress &addr, quint16 port);
};

#endif // DIALOG_H
